/*
 * To change this template, choose Tools | Templates
 * and open the template in the editor.
 */
package jpa.entities;

import java.io.Serializable;
import javax.persistence.Basic;
import javax.persistence.Column;
import javax.persistence.Entity;
import javax.persistence.Id;
import javax.persistence.NamedQueries;
import javax.persistence.NamedQuery;
import javax.persistence.Table;
import javax.validation.constraints.NotNull;
import javax.validation.constraints.Size;
import javax.xml.bind.annotation.XmlRootElement;

/**
 *
 * @author julio
 */
@Entity
@Table(name = "trips", catalog = "transit", schema = "")
@XmlRootElement
@NamedQueries({
    @NamedQuery(name = "Trips.findAll", query = "SELECT t FROM Trips t"),
    @NamedQuery(name = "Trips.findByRouteId", query = "SELECT t FROM Trips t WHERE t.routeId = :routeId"),
    @NamedQuery(name = "Trips.findByServiceId", query = "SELECT t FROM Trips t WHERE t.serviceId = :serviceId"),
    @NamedQuery(name = "Trips.findByTripId", query = "SELECT t FROM Trips t WHERE t.tripId = :tripId"),
    @NamedQuery(name = "Trips.findByTripHeadsign", query = "SELECT t FROM Trips t WHERE t.tripHeadsign = :tripHeadsign"),
    @NamedQuery(name = "Trips.findByTripShortName", query = "SELECT t FROM Trips t WHERE t.tripShortName = :tripShortName"),
    @NamedQuery(name = "Trips.findByDirectionId", query = "SELECT t FROM Trips t WHERE t.directionId = :directionId"),
    @NamedQuery(name = "Trips.findByBlockId", query = "SELECT t FROM Trips t WHERE t.blockId = :blockId"),
    @NamedQuery(name = "Trips.findByShapeId", query = "SELECT t FROM Trips t WHERE t.shapeId = :shapeId")})
public class Trips implements Serializable {
    private static final long serialVersionUID = 1L;
    @Basic(optional = false)
    @NotNull
    @Size(min = 1, max = 45)
    @Column(name = "route_id", nullable = false, length = 45)
    private String routeId;
    @Basic(optional = false)
    @NotNull
    @Size(min = 1, max = 45)
    @Column(name = "service_id", nullable = false, length = 45)
    private String serviceId;
    @Id
    @Basic(optional = false)
    @NotNull
    @Size(min = 1, max = 45)
    @Column(name = "trip_id", nullable = false, length = 45)
    private String tripId;
    @Size(max = 45)
    @Column(name = "trip_headsign", length = 45)
    private String tripHeadsign;
    @Size(max = 45)
    @Column(name = "trip_short_name", length = 45)
    private String tripShortName;
    @Size(max = 2)
    @Column(name = "direction_id", length = 2)
    private String directionId;
    @Size(max = 45)
    @Column(name = "block_id", length = 45)
    private String blockId;
    @Basic(optional = false)
    @NotNull
    @Size(min = 1, max = 45)
    @Column(name = "shape_id", nullable = false, length = 45)
    private String shapeId;

    public Trips() {
    }

    public Trips(String tripId) {
        this.tripId = tripId;
    }

    public Trips(String tripId, String routeId, String serviceId, String shapeId) {
        this.tripId = tripId;
        this.routeId = routeId;
        this.serviceId = serviceId;
        this.shapeId = shapeId;
    }

    public String getRouteId() {
        return routeId;
    }

    public void setRouteId(String routeId) {
        this.routeId = routeId;
    }

    public String getServiceId() {
        return serviceId;
    }

    public void setServiceId(String serviceId) {
        this.serviceId = serviceId;
    }

    public String getTripId() {
        return tripId;
    }

    public void setTripId(String tripId) {
        this.tripId = tripId;
    }

    public String getTripHeadsign() {
        return tripHeadsign;
    }

    public void setTripHeadsign(String tripHeadsign) {
        this.tripHeadsign = tripHeadsign;
    }

    public String getTripShortName() {
        return tripShortName;
    }

    public void setTripShortName(String tripShortName) {
        this.tripShortName = tripShortName;
    }

    public String getDirectionId() {
        return directionId;
    }

    public void setDirectionId(String directionId) {
        this.directionId = directionId;
    }

    public String getBlockId() {
        return blockId;
    }

    public void setBlockId(String blockId) {
        this.blockId = blockId;
    }

    public String getShapeId() {
        return shapeId;
    }

    public void setShapeId(String shapeId) {
        this.shapeId = shapeId;
    }

    @Override
    public int hashCode() {
        int hash = 0;
        hash += (tripId != null ? tripId.hashCode() : 0);
        return hash;
    }

    @Override
    public boolean equals(Object object) {
        // TODO: Warning - this method won't work in the case the id fields are not set
        if (!(object instanceof Trips)) {
            return false;
        }
        Trips other = (Trips) object;
        if ((this.tripId == null && other.tripId != null) || (this.tripId != null && !this.tripId.equals(other.tripId))) {
            return false;
        }
        return true;
    }

    @Override
    public String toString() {
        return "jpa.entities.Trips[ tripId=" + tripId + " ]";
    }
    
}
